<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header">
                <a class="btn btn-app" data-toggle="modal" data-target="#install_add">
                    <i class="fa fa-plus"></i> 添加
                </a>
            </div><!-- /.box-header -->
            <div class="modal fade modal" id="install_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content table-responsive">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel">添加已安装用户</h4>
                        </div>
                        <div class="modal-body">

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        时间
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入安装时间" value="<?php echo date("Y-m-d H:i:s"); ?>" id="time"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        账号
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="用户账号" value="07720000" id="account"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        套餐
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="套餐和增送的时间" id="type"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        电话
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入客户的手机号码" id="mobile"/>
                                </div>
                            </div>


                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        姓名
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入客户名字" id="name"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        速率
                                    </div>
                                    <select class="form-control" id="speed">
                                        <option>10M</option>
                                        <option>50M</option>
                                        <option>100M</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        金额
                                    </div>
                                    <select class="form-control" id="price">
                                        <optgroup label="100M">
                                            <option>2016</option>
                                            <option>1780</option>
                                            <option>1480</option>
                                            <option>999</option>
                                            <option>980</option>
                                        </optgroup>
                                        <optgroup label="50M">
                                            <option>1560</option>
                                            <option>1260</option>
                                            <option>699</option>
                                            <option>820</option>
                                        </optgroup>
                                        <optgroup label="10M">
                                            <option>1460</option>
                                            <option>1160</option>
                                            <option>600</option>
                                            <option>400</option>
                                        </optgroup>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        大麦
                                    </div>
                                    <select class="form-control" id="domybox">
                                        <option>有</option>
                                        <option>无</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        到期
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入到期时间" value="<?php echo date("Y-m-d H:i:s"); ?>" id="otime"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        社区
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请选择安装社区名字" id="addr"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        地址
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入安装地址" id="address"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        来源
                                    </div>
                                    <select class="form-control" id="source">
                                        <option>摆点</option>
                                        <option>DM单</option>
                                        <option>吊旗</option>
                                        <option>老客户介绍</option>
                                        <option>回访</option>
                                        <option>微信</option>
                                        <option>装机给名片</option>
                                        <option>海报</option>
                                        <option>公司活动</option>
                                        <option>通知单</option>
                                        <option>喷绘广告</option>
                                        <option>外区</option>
                                        <option>宣传单</option>
                                        <option>代办点</option>
                                        <option>体验店</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        备注
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="备注" id="remarks"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        销售
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="备注" value="<?php echo $_SESSION['uname'];?>" id="uname"/>
                                </div>
                            </div>

                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-danger pull-left" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-success pull-right" data-dismiss="modal" onclick='install_add()'>保存</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-body">
                <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <div class="row">
                        <div class="col-sm-6"></div>
                        <div class="col-sm-6"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <table class="table table-bordered table-hover dataTable">
                                <thead>
                                <tr role="row">
                                    <th>安装时间</th>
                                    <th>账号</th>
                                    <th>电话</th>
                                    <th>姓名</th>
                                    <th>速率</th>
                                    <th>到期时间</th>
                                    <th>社区名</th>
                                    <th>详细地址</th>
                                    <th>备注</th>
                                    <?php if(
                                        $_SESSION['l'] === "后勤统计" ||
                                        $_SESSION['l'] === "管理员" ||
                                        $_SESSION['l'] === "超级管理员"
                                    ) {
                                        echo '<th>销售员</th>';
                                    }
                                    ?>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach($data['InstallList'] as $k){?>
                                    <?php if (
                                        $k['uname'] === $_SESSION['uname'] ||
                                        $_SESSION['l'] === "后勤统计" ||
                                        $_SESSION['l'] === "管理员" ||
                                        $_SESSION['l'] === "超级管理员"
                                    ){?>
                                        <tr>
                                            <td class=""><?php echo $k['time']?></td>
                                            <td class=""><?php echo $k['account']?></td>
                                            <td class=""><?php echo $k['mobile']?></td>
                                            <td class=""><?php echo $k['name']?></td>
                                            <td class=""><?php echo $k['speed']?></td>
                                            <td class=""><?php echo $k['otime']?></td>
                                            <td class=""><?php echo $k['addr']?></td>
                                            <td class=""><?php echo $k['address']?></td>
                                            <td class=""><?php echo $k['remarks']?></td>
                                            <?php if(
                                            $_SESSION['l'] === "后勤统计" ||
                                            $_SESSION['l'] === "管理员" ||
                                            $_SESSION['l'] === "超级管理员"
                                            ) {
                                                echo '<td class="">'.$k['uname'].'</td>';
                                            }
                                            ?>
                                        </tr>
                                        <?php /*endstart*/} /*endforeach*/ }?>
                                </tbody>
                                <tfoot>
                                <tr role="row">
                                    <th>安装时间</th>
                                    <th>电话</th>
                                    <th>姓名</th>
                                    <th>速率</th>
                                    <th>到期时间</th>
                                    <th>社区名</th>
                                    <th>详细地址</th>
                                    <th>备注</th>
                                    <?php if(
                                        $_SESSION['l'] === "后勤统计" ||
                                        $_SESSION['l'] === "管理员" ||
                                        $_SESSION['l'] === "超级管理员"
                                    ) {
                                        echo '<th>销售员</th>';
                                    }
                                    ?>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>
</div>